﻿using BLL;
using IBLL;
using Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1.登录老师账号界面
{
    public partial class EcamCorrect : Form
    {
        IFrExamManage_IBLL frExam = new FrExamManage_BLL();
        public string ids="";
        public EcamCorrect()
        {
            InitializeComponent();
        }
        public EcamCorrect(string id)
        {
            InitializeComponent();
            ids = id;
            dataGridView1.DataSource= frExam.SubMit_info($" select 考号=StudentId,姓名= StudentName,年龄 ,班级=ClassName from view_1 where StudentId in (select StudentId from SingleChoice_Examinee where Exam_id={id} )").Tables[0];
        }

        private void EcamCorrect_Paint(object sender, PaintEventArgs e)
        {
           
        }

        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.SelectedRows.Count < 0 || e.RowIndex < 0)
            {
                return;
            }

            dataGridView1.Rows[e.RowIndex].Selected = true;
            Form2 form = new Form2(dataGridView1.SelectedRows[0].Cells[0].Value.ToString(),ids);
            form.ShowDialog();
        }
    }
}
